package me.xiaoyan.java.chapter14;

public class ArrayUtils {

	/**
	 * 获取 int数组中的最大值
	 * @return
	 */
	public int getMaxNumber(int[] numbers)
	{
		int maxNumber = numbers[0];
		//循环获取最大值
		for(int i = 0; i < numbers.length;i++)
		{
			if(maxNumber < numbers[i]){
				maxNumber = numbers[i];
			}
		}
		return maxNumber;
	}
	public void test(String[] names,String address
			,int age)
	{
		
	}
	
	
	
	public static void main(String[] args) {
		ArrayUtils util = new ArrayUtils();//对象
		int[] num1 = {1,2,3,4,123,23,24};
		//获取最大值
		int maxNumber = util.getMaxNumber(num1);
		System.out.println(maxNumber);
		
		
	}
	
}
